﻿<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>选择用户</title>
    <!--框架必需start-->
    <link href="~/Content/Styles/learunui-framework.css" rel="stylesheet" />
    <script src="~/Content/Scripts/jquery/jquery-1.8.2.min.js"></script>
    <script src="~/Content/Scripts/learunui-framework.js"></script>
    <!--框架必需end-->
    <!--树形组件start-->
    <link href="~/Content/Scripts/tree/tree.css" rel="stylesheet" />
    <script src="~/Content/Scripts/tree/tree.js"></script>
    <!--树形组件end-->
    <script>
        $(function () {
            GetList("");
            $(".ScrollBar").height($(window).height() - 51);
            //失去焦点时，提示的处理
            $("#keyword").click(function () {
                if ($(this).hasClass('searchTips')) {
                    $(this).removeClass('searchTips'); $(this).val('');
                }
            }).blur(function () {
                if ($(this).val() == '') {
                    $(this).addClass('searchTips'); $(this).val('请输入关键字...');
                }
            }).bind("keyup", function (e) {
                if ($(this).hasClass('searchTips')) {
                    $(this).removeClass('searchTips'); $(this).val('');
                }
                GetList($(this).val());
            })
        })
        //加载用户列表
        function GetList(keyword) {
            var itemtree = {
                onnodeclick: function (item) {
                    var Data = {
                        UserId: item.id,
                        RealName: item.realname,
                        Account: item.account,
                        Code: item.code
                    }
                    top.WriteEmail.CallbackSetUser(Data);
                },
                url: "@Url.Content("~/Utility/OptionUserJson")?keyword=" + escape(keyword),
                theme: "bbit-tree-arrows"
            };
            $("#ItemsTree").treeview(itemtree);
            Loading(false);
        }
    </script>
</head>
<body>
    <div class="search_bar" style="height: 35px; line-height: 35px; padding-left: 5px; padding-right: 10px;">
        <input id="keyword" type="text" class="keyword searchTips" style="width: 100%" value="请输入关键字..." />
    </div>
    <div class="ScrollBar topline" id="ItemsTree" style="padding: 5px;">
    </div>
    <style>
        .bbit-tree-ec-icon {
            width: 0px;
        }
    </style>
</body>
</html>
